package empresadetransportes;

import java.util.ArrayList; 

// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.542E5292-9004-A123-D915-5CF61951BFEB]
// </editor-fold> 
public class Adm_Buses {

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.76926EF3-C9B0-A64A-0983-5997B61B3BBA]
    // </editor-fold> 
    private ArrayList<Bus> buses;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.7B97C37D-BD23-FB7C-7850-A80D7B9B5D0D]
    // </editor-fold> 
    public Adm_Buses () {
        
        this.buses = new ArrayList<Bus>();
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.0E2B4070-5AA4-E93E-52FF-426631752F47]
    // </editor-fold> 
    public ArrayList<Bus> getBuses () {
        return buses;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.83691507-E654-7DAF-644B-875767303C8C]
    // </editor-fold> 
    public void setBuses (ArrayList<Bus> val) {
        this.buses = val;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.3D488C45-4AE0-3D3B-A78A-74844D9889DF]
    // </editor-fold> 
    public void registrarBus (String placa, String marca, String modelo, String tipobus, String fechaAdq,
                              String anoFabrica, String kilometraje, String numeroPisos) {
        this.buses.add(new Bus(placa, marca, modelo, tipobus, fechaAdq, anoFabrica, kilometraje, numeroPisos));
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.17582451-A007-0A96-B86D-D1C12809261D]
    // </editor-fold> 
    public Bus buscarBus (String placa) {
        Bus busEncontrado= null;
        for (Bus bus:buses){
            if (bus.getPlaca().equals(placa)){
                busEncontrado=bus;
                break;
            }
        }
        return busEncontrado;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.C17896A0-F0FF-0C8D-8333-1BECC8C69DA4]
    // </editor-fold> 
    public void eliminarBus (String placa) {
        Bus bus = buscarBus(placa);
        buses.remove(bus);
        
    }

}

